package com.youngjun.user.controller;

import com.youngjun.common.mybatis.web.BaseController;
import com.youngjun.common.mybatis.web.Response;
import com.youngjun.user.api.IRegionRestApi;
import com.youngjun.user.pojo.vo.RegionVO;
import com.youngjun.user.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/region")
public class RegionController implements IRegionRestApi,BaseController {

    @Autowired
    RegionService regionService;

    @Override
    public Response<List<RegionVO>> list(Long parentId) {
        List<RegionVO> data = regionService.queryListByParentId(parentId);
        return new Response<>(data);
    }

}
